﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyAlbum.Utility
{
    public class GenericValidationSummary : IValidationSummary
    {
        private Dictionary<string,string> errors;

        public Dictionary<string, string> Errors
        {
            get
            {
                if (errors == null)
                {
                    errors = new Dictionary<string, string>();
                }
                return errors;
            }
        }

        public bool IsValid
        {
            get
            {
                return Errors.Count == 0;
            }
        }
      

        public void AddError(string key, string errorMessage)
        {
            Errors.Add(key, errorMessage);
        }

      
    }
}
